//
//  MM_LoginBottomLoginView.m
//  MallManage_IOS
//
//  Created by 张浩 on 2023/9/19.
//

#import "MM_LoginBottomLoginView.h"
#import "MM_ImageButton.h"

@interface MM_LoginBottomLoginView ()

@end

@implementation MM_LoginBottomLoginView

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        NSArray *nameArr = @[@"密码登录",@"手机登录"];
        NSArray *imageArr = @[@"passwordUserLoginImage",@"phoneUserLoginImage"];
        NSArray *colorArr = @[@"#333333",@"#999999"];

        CGFloat max = 80;
        
        for (int i=0; i<nameArr.count; i++) {
            
            MM_ImageButton *button = [MM_ImageButton buttonWithType:UIButtonTypeCustom withSpace:2];
            [button setTitle:nameArr[i] forState:UIControlStateNormal];
            button.titleLabel.font = FONT(12);
            button.buttonStyle = FPButtonImageTop;
            [button setTitleColor:[ColorUtil colorWithHexadecimal:colorArr[i]] forState:UIControlStateNormal];
            [button setImage:[UIImage imageNamed:imageArr[i]] forState:UIControlStateNormal];
//            [button setImage:[UIImage imageNamed:@"ldleCollectionSelectedImage"] forState:UIControlStateSelected];
            button.selected = NO;
    //        _collectionBtn.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
//            [button addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
            button.padding = 2;
            button.tag = 100;
            [self addSubview:button];

            [button mas_makeConstraints:^(MASConstraintMaker *make) {
                
                make.left.equalTo(max);
                make.centerY.equalTo(self);
                make.width.equalTo(60);
                make.height.equalTo(65);
            }];
            
            max += 100 + 60;
        }
    }
    return self;
}

@end
